<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/5/25 0025
 * Time: 9:50
 */

namespace app\manager\controller;

use classes\Verify;
use dce\feedback;
use member\captain\admin;

class Common extends Base
{
    function __initialize()
    {
        parent::__construct();
    }

    public function login()
    {
        return $this->fetch();
    }

    public function logging(){
        config('default_return_type', 'json');
        $verify = input('post.verify');
        $username = input('post.username');
        $password = input('post.password');
        if (!Verify::check($verify)) return feedback::info_false('验证码错误!'); // 返回验证错误提示
        if (!admin::login($username, $password)) return feedback::take(); // 取失败提示
        return feedback::info_true('登录成功!');
    }
}